<html>
<head><meta charset="utf-8"><title>chalk tests on nightly chalk#220 · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html">chalk tests on nightly chalk#220</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="164825193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825193">(May 03 2019 at 19:59)</a>:</h4>
<p>BTW, a good issue for someone who wants to hack on chalk quickly is to fix the nightly tests :)</p>
<p>My suggestion would be to strip trailing commas, but we can also just edit the tests:</p>
<p><a href="https://github.com/rust-lang/chalk/issues/220" target="_blank" title="https://github.com/rust-lang/chalk/issues/220">https://github.com/rust-lang/chalk/issues/220</a></p>



<a name="164825341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825341">(May 03 2019 at 20:00)</a>:</h4>
<p>We have exactly the same problem in rust-analyzer :D</p>



<a name="164825343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825343">(May 03 2019 at 20:00)</a>:</h4>
<p>lol</p>



<a name="164825351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825351">(May 03 2019 at 20:00)</a>:</h4>
<p>breaking change!</p>



<a name="164825369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825369">(May 03 2019 at 20:00)</a>:</h4>
<p>ps <span class="user-mention" data-user-id="126931">@centril</span> clearly people <em>do</em> rely on <code>Debug</code> impl output ;)</p>



<a name="164825393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825393">(May 03 2019 at 20:01)</a>:</h4>
<p>obligatory spacebar heater xkcd link</p>



<a name="164825411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825411">(May 03 2019 at 20:01)</a>:</h4>
<p>lol</p>



<a name="164825415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825415">(May 03 2019 at 20:01)</a>:</h4>
<p>yes</p>



<a name="164825417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825417">(May 03 2019 at 20:01)</a>:</h4>
<p>exactly</p>



<a name="164825420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825420">(May 03 2019 at 20:01)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  yes, it happens sometimes, annoying</p>



<a name="164825438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825438">(May 03 2019 at 20:01)</a>:</h4>
<p>Actually, I think it'd be a nice library to put on <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> to do the comparison</p>



<a name="164825446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825446">(May 03 2019 at 20:01)</a>:</h4>
<p>it could do normalization of this kind etc</p>



<a name="164825503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825503">(May 03 2019 at 20:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://github.com/mitsuhiko/insta/" target="_blank" title="https://github.com/mitsuhiko/insta/">https://github.com/mitsuhiko/insta/</a> exists</p>



<a name="164825507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825507">(May 03 2019 at 20:02)</a>:</h4>
<p>of course it does</p>



<a name="164825524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825524">(May 03 2019 at 20:02)</a>:</h4>
<p>(maybe we should port to that then...)</p>



<a name="164825528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825528">(May 03 2019 at 20:02)</a>:</h4>
<p>gotta run</p>



<a name="164825541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825541">(May 03 2019 at 20:02)</a>:</h4>
<p>we should use property based testing more :P</p>



<a name="164825550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164825550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164825550">(May 03 2019 at 20:02)</a>:</h4>
<p>//shameless plug for proptest</p>



<a name="164854434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164854434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164854434">(May 04 2019 at 07:06)</a>:</h4>
<p>insta doesn't handle those differences, though I suppose you might be able to use insta's <a href="https://github.com/mitsuhiko/insta#redactions" target="_blank" title="https://github.com/mitsuhiko/insta#redactions">redactions</a> for that</p>



<a name="164854753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164854753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164854753">(May 04 2019 at 07:14)</a>:</h4>
<p>Oh wait, seems like you can't use redactions in the <code>assert_debug_snapshot_matches</code> (only snapshots based on <code>serde::Serialize</code> support redactions)</p>



<a name="164862734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164862734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164862734">(May 04 2019 at 10:49)</a>:</h4>
<p>Created <a href="https://github.com/rust-lang/chalk/pull/222" target="_blank" title="https://github.com/rust-lang/chalk/pull/222">#222</a> to strip the commas, but there's still one failing test because of a change in debug formatting where the order changed</p>



<a name="164862871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164862871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164862871">(May 04 2019 at 10:51)</a>:</h4>
<p>Curious. I guess it's a hashset.</p>



<a name="164862935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164862935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164862935">(May 04 2019 at 10:52)</a>:</h4>
<p>We could probably override Debug and sort the keys ourselves or something to ensure a consistent order, independent of the underlying <code>Debug</code> impl.</p>



<a name="164862945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164862945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164862945">(May 04 2019 at 10:52)</a>:</h4>
<p>(I wuld probably do this by creating a vec, sorting the vec, and then invoking the <em>vector's</em> debug impl)</p>



<a name="164864740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164864740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164864740">(May 04 2019 at 11:48)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> That would work if <code>DelayedLiteral</code> implemented <code>Ord</code>, but looking at the <a href="https://github.com/rust-lang/chalk/blob/master/chalk-engine/src/derived.rs#L1" target="_blank" title="https://github.com/rust-lang/chalk/blob/master/chalk-engine/src/derived.rs#L1">hand-written Eq impls</a>, it seems like we'd prefer to avoid that?</p>



<a name="164865004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164865004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164865004">(May 04 2019 at 11:57)</a>:</h4>
<p>Or we could sort the debug output instead... hmm</p>



<a name="164865529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164865529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164865529">(May 04 2019 at 12:12)</a>:</h4>
<p>Another alternative is to just fix the seed in the hash-map. Not protecting from DoS seems fine for chalk? And consistent ordering also could help in printfdebuggin</p>



<a name="164867706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164867706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164867706">(May 04 2019 at 13:15)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> That doesn't necessarily fix it though, since even with a fixed seed the implementation might've changed between stable and nightly</p>



<a name="164867722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164867722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164867722">(May 04 2019 at 13:15)</a>:</h4>
<p>Ah, riiiight, it's not because of the seed, it's because of hashbrown</p>



<a name="164870170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk%20tests%20on%20nightly%20chalk%23220/near/164870170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk.20tests.20on.20nightly.20chalk.23220.html#164870170">(May 04 2019 at 14:19)</a>:</h4>
<p>Alright, ended up just writing out a debug impl for <code>DelayedLiteralSet</code> that sorts by debug output. It's a bit of a hack, but it fixes the tests <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>